<?php

/*
 * Functions.php
 * Henrik Volckmer
 */

/* Takes an html file and replaces all the tags in it with the replacements supplied.
 * I.E. <a href="[LINK_HOME]">[LINK_HOME_TEXT]</a> will turn into
 * <a href="index.php">Home</a>
 */
function parse_html($filename, $tags, $replacements)
{
	// get a file as a string
	$html = implode(" ", file($filename));
	
	// replace all the tags
	$html = preg_replace($tags, $replacements, $html);
	
	return $html;
}
 
?>